<template>
<div class="container">
    <!-- 核算单 -->
    <!-- 列表 -->
    <countListCom v-if="accountingShow" @goMeasurement="goMeasurement"/>
    <!-- 核算 -->
    <countSumCom v-else :countAccounting="countAccounting"  @goBack="goBack" :isReset="false"/>
</div>
</template>

<script setup>
import countListCom from './components/countListCom'
import countSumCom from './components/countSumCom'
import { costingListGetInfo } from '@/api/costSum'
import {useRouter} from 'vue-router'
const router = useRouter()
let accountingShow = ref(true)
const countAccounting = ref(null)
// 跳转到核算详情
const goMeasurement = (v)=>{ 
    costingListGetInfoFn(v.costingId)
}
// 核算详情接口
const costingListGetInfoFn = async (v) => {

    let params = {
        costingId: v
    }
    let { code, data } = await costingListGetInfo(params)
    if (code == 200) {
        countAccounting.value = data
        accountingShow.value = false
    }
}
// 返回上一级
const goBack = ()=>{
    accountingShow.value = true
}
</script>

<style scoped lang="scss"></style>